import { ref } from "vue";
import { getLabelByValueFromEnum, handleDateRowRender } from "/@/utils/common";
import { DocType } from "/@/api/main/financial/models";

export function useCheckBill() {
  const docColumns = ref([
    {
      title: "单据类型",
      dataIndex: "type",
      customRender({ text }) {
        return getLabelByValueFromEnum(text, DocType, "docType");
      },
    },
    {
      title: "单号",
      dataIndex: "orderNo",
    },
    {
      title: "关联单据",
      dataIndex: "refOrderNo",
    },
    {
      title: "供应商",
      dataIndex: "supplierName",
    },
    {
      title: "发生仓库",
      dataIndex: "warehouse",
    },
    {
      title: "发生日期",
      dataIndex: "createTime",
      customRender: handleDateRowRender,
    },
    {
      title: "发生数量",
      dataIndex: "quantity",
    },
    {
      title: "发生金额",
      dataIndex: "amount",
    },
    {
      title: "制单日期",
      dataIndex: "tabulationTime",
      customRender: handleDateRowRender,
    },
    {
      title: "审核日期",
      dataIndex: "reviewTime",
      customRender: handleDateRowRender,
    },
    {
      title: "备注",
      dataIndex: "remark",
    },
  ]);

  return {
    docColumns,
  };
}
